<template>
  <div>
    <div v-for="article in articles" :key="article.id">
        <h1>{{article.title}}</h1>
        <p>{{article.content}}</p>
        <button @click="$router.push('/detail/'+article.id)">{{article.id}}</button>
    </div>
  </div>
</template>

<script>
export default {
    name:"NewArticle",
    data(){
        return{
            articles:[]
        }
    },
    created(){
        this.articles = [
            {id:1,title:"title1",content:"content1"},
            {id:2,title:"title2",content:"content2"},
            {id:3,title:"title3",content:"content3"}
        ]
    },
    methods:{   
        show(id){
            console.log("show"+id);
        }
    }
};
</script>

<style></style>
